<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String skin = request.getParameter("skin");
if(skin != null && skin.length()>0){
	session.setAttribute("skin", skin);
	Cookie cookie = new Cookie("skin", skin);
	response.addCookie(cookie);
}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<link rel="Shortcut Icon" href="<%=basePath%>style/jx.ico" type="image/x-icon" />
<title>公共开发平台</title>
<jsp:include page="/admin/common/css/style_index.jsp"></jsp:include>
<jsp:include page="/admin/common/css/style_easyui.jsp"></jsp:include>
<link rel="stylesheet" type="text/css" href="<%=basePath%>js/lib/jquery/superfish/css/superfish.css"/>
<link rel="stylesheet" type="text/css" href="<%=basePath%>js/lib/jquery/superfish/css/superfish-navbar.css"/>
<script type="text/javascript" src="<%=basePath%>js/lib/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/lib/jquery/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/lib/jquery/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=basePath%>js/lib/jquery/superfish/hoverIntent.js"></script>
<script type="text/javascript" src="<%=basePath%>js/lib/jquery/superfish/superfish.js" ></script>
<script type="text/javascript" src="<%=basePath%>js/cookie.js"></script>

<style type="text/css">
html,body {
	overflow: hidden;
}
</style>

<script type="text/javascript">
$(function(){
	bindMenuClickEvent();
	$('#sys').click();
	//showSysMsg('你有新邮件，请注意查收!');
});

function loadSubMenu(ssName){
	var url = '<%=basePath%>subMenu/menu_' + ssName + '.html';
	$.post(url, {ssName: ssName, ct: (new Date()).getTime()}, function(data){
		$('#subMenuBar').empty();
		$('#subMenuBar').append(data);
		$('ul.sf-menu').superfish();
	});
}

function showSysMsg(msg){
	$.messager.show({
		title:'系统提示信息',
		msg:msg,
		timeout:30000,
		showSpeed: 3000,
		showType:'fade'
	});
}

function addTab(title, url){
	var tabs = window.frames['content'].$('#tabs');
	url = '<%=basePath%>' + url;
	var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%;"></iframe>';
	if (tabs.tabs('exists', title)){
		tabs.tabs('select', title);  
	}else if(tabs.tabs('tabs').length == 11){
		$.messager.alert('提示信息', '打开的窗口过多，请先关闭一些窗口！', 'info');
	}else{
		tabs.tabs('add', {
			title: title,
			content: content,
			closable: true,
			iconCls: 'icon-reload'
		});
	}
	window.frames['content'].tabClose();
}

function logout(){
	var url = '<%=basePath%>logout.action';
	window.location.href = url;
	/*
	$.messager.confirm('确认信息', '你确认要退出当前系统吗？', function(r){
		if (r){
			window.location.href = url;
		}}
	);
	*/
}

//主菜单鼠标点击交互动作
function bindMenuClickEvent(){
	$('#oa').click(function(){
		loadSubMenu('oa');
		$(this).removeClass().addClass('menuALine');
		$('#bss').removeClass().addClass('menuB');
		$('#fin').removeClass().addClass('menuC');
		$('#town').removeClass().addClass('menuD');
		$('#ser').removeClass().addClass('menuE');
		$('#sys').removeClass().addClass('menuF');
	});
	$('#sys').click(function(){
		loadSubMenu('sys');
		$(this).removeClass().addClass('menuFLine');
		$('#oa').removeClass().addClass('menuA');
		$('#bss').removeClass().addClass('menuB');
		$('#fin').removeClass().addClass('menuC');
		$('#town').removeClass().addClass('menuD');
		$('#ser').removeClass().addClass('menuE');
	});
}

function changeSkin() {
	var skin = $.cookie("skin");
	if(typeof skin == 'undefined' || skin == null){
		skin = 'blue';
	}
	skin = getSkin(skin);
	$.cookie("skin", skin, {expires:7});
	window.location = "<%=basePath%>index.action?skin=" + skin;
}
</script>
</head>
<body onload="setContainerSize()">
	<div id="top">
		<div class="topColor"></div>
		<div class="indexLogo">金鑫公共开发平台</div>
		<div class="mainMenu">
			<ul>
				<li><a href="javascript:void(0);" id="oa" class="menuA">界面例子</a></li>
				<li><a href="javascript:void(0);" id="sys" class="menuF">系统管理</a></li>
				<li><a href="javascript:void(0);" id="logout" class="menuG" onclick="javascript:logout();return false;">退出系统</a></li>
			</ul>
		</div>
		<div class="subMenuC">
          <div class="subMenuL">
          <div class="subMenuR">
          <div class="subMenu" id="subMenuBar"></div>
          </div>
          </div>
        </div>
	</div>
	<div id="center">
    <div class="contentBorderL">
      <div></div>
    </div>
		<div class="contentMargins">
			<iframe id="content" frameborder="0" name="content" scrolling="auto" src="<%=basePath%>tabs.action"></iframe>
		</div>
     <div class="contentBorderR">
      <div></div>
    </div>
	</div>
	<div id="bottom">
		<div class="bottomBg">
			<div class="bottomBgL">
				<div class="bottomBgR"><a href="javascript:void(0);" class="skin" onclick="changeSkin();" title="点击切换皮肤"></a>版权所有(C)重庆金鑫公司&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;服务热线：400-000-3877</div>
			</div>
		</div>
	</div>
	
	
	<script type="text/javascript">
		//----------设定中间那个div的高度-------
		function setContainerSize() {
			size = window['innerHeight'] || document.documentElement.clientHeight; //获取浏览器高度
			size = size - 136; //去掉顶部的106和底部的30
			document.getElementById('center').style.height = size + "px"; //设置div高度
			document.getElementById('content').style.height = size + "px"; //设置框架高度
		}
		window.onresize = setContainerSize; //浏览器大小变化的时候调用
	</script>
</body>
</html>